<?php

$thisPage = "newsletter";

TemplateHelper::useLayout("text");

function buildLayout(&$smarty) {
    global $subpage;
    $smarty->assign("text", getContent($smarty));
    $smarty->assign("virt_exhibition", true);
}


function getPageHeader() {
    return TemplateHelper::getDefaultPageHeader();
}

function getPageFooter() {
    return TemplateHelper::getDefaultPageFooter();
}

function getContent($smarty) {
    global $thisPage;

    initDatabase();
    Database::loadModel("newsletter");
    $content = Database::getModel()->getLatestNewsletter();
    $smarty->assign("newsletter", $content);
    return array(
        title => "Newsletter",
        content => $smarty->fetch(TemplateHelper::getTemplateFile($thisPage, $thisPage . ".content")),
        backtothetop => true,
    );
}

?>
